package com.tanhua.server.controller;

import com.tanhua.model.vo.HuanXinUserVo;
import com.tanhua.server.service.HuanXinService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * 环信登录控制层（根据当前用户id获取环信账号 密码）
 */
@RestController
@RequestMapping("/huanxin")
@Slf4j
public class HuanXinController {

    @Autowired
    private HuanXinService huanXinService;

    /**
     * 获取环信登录账号 密码
     */
    @RequestMapping(value = "/user",method = RequestMethod.GET)
    public ResponseEntity getHuanXinUser(){
        HuanXinUserVo huanXinUserVo =huanXinService.getHuanXinUser();
        log.debug("**************************获取环信登录账号 密码************************"+huanXinUserVo.toString());
        return ResponseEntity.ok(huanXinUserVo);
    }
}
